home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / gfx / edit / universalgio44.lha / UniversalGIO / HHsMakeAnim.rx < prev    next >
Text File  |  1996-07-20  |  2KB  |  77 lines

  1. /* MakeAnim.rx for Photogenics © by Helmut Hoffmann 1996 */
  2. /* Make HHsYUVSq animation from a directory of pictures */
  3. /* with Photogenics 2 or higher */
  4.  
  5. OPTIONS RESULTS
  6.  
  7. if ~SHOW('p','PHOTOGENICS.1') then do
  8.   say "This script needs a running Photogenics 2 or higher"
  9.   say "and HHsYUSSqSaver.gio to convert animations"
  10.   exit
  11. end
  12.  
  13. say "Please switch to Photogenics screen for file selection."
  14. address PHOTOGENICS.1
  15. PgsToFront
  16.  
  17. address command
  18. 'requestfile pubscreen "Photogenics" noicons title "Select source directory:" >ENV:HHsYUVAnimSource'
  19. if rc~=0 then exit
  20. 'list $HHsYUVAnimSource pat ~(#?.info) files lformat %f%n >t:HHsAnimList'
  21. if (open(SourceList,'t:HHsAnimList','READ')=0) then do
  22.    say "Can't read file list"
  23.    'wait 5'
  24.    exit
  25. end
  26. framemax=0
  27. DO FOREVER
  28.   sourcefile=READLN(SourceList)
  29.   if length(sourcefile)=0 then leave
  30.   framemax=framemax+1
  31. END
  32. say "Number of files found:" framemax
  33. if framemax=0 then exit
  34. close(SourceList)
  35. 'sort t:HHsAnimList to t:HHsAnimListS'
  36. if (open(SourceList,'t:HHsAnimListS','READ')=0) then do
  37.    say "Can't read file list"
  38.    'wait 5'
  39.    exit
  40. end
  41.  
  42. address PHOTOGENICS.1
  43. asksavefile '"Select destination HHsYUVSq animation name"' ""
  44. if rc~=0 then exit
  45. destanim=result
  46.  
  47. say "Creating animation:" destanim
  48.  
  49. OpenProgress '"Animation creation"' '"Anim creation begins..."'
  50. frame=1
  51. DO FOREVER
  52.   sourcefile=READLN(SourceList)
  53.   if length(sourcefile)=0 then leave
  54.   say "Processing file" sourcefile
  55.   SetProgress '"Load 'sourcefile'"' (frame*2-1)*50/framemax
  56.   if result=0 then leave
  57.   LoadHide '"'sourcefile'"'
  58.   if rc~=0 then leave
  59.   buffer=result
  60.   say "Trying to save frame " frame
  61.   SetProgress '"Save frame 'frame'"' frame*100/framemax
  62.   if result=0 then do
  63.     CLOSE buffer
  64.     leave
  65.   end
  66.   SAVE buffer "HHsYUVSequence" "" destanim
  67.   if rc~=0 then do
  68.     CLOSE buffer
  69.     SHOWERROR '"Animation creation failed! Check image dimensions etc..."'
  70.     leave
  71.   end
  72.   CLOSE buffer
  73.   frame=frame+1
  74. END
  75. CloseProgress
  76.  
  77.